define(
    function (require) {
        var BaseFormModel = require('common/FormModel');
        var Data = require('./Data');
        var util = require('common/util');

        function FormModel() {
            BaseFormModel.apply(this, arguments);
            var entityName = this.getUrlType();
            this.addData(new Data(entityName));
        }

        FormModel.prototype.uploaderIds = [
            'logo-pic', 'qrcode'
        ];

        FormModel.prototype.prepare = function () {
            BaseFormModel.prototype.prepare.call(this);
            this.set('uploadUrl', '/api/upload/4');
            
            var mallid = this.get('mallid');
            if (util.isString(mallid)) {
                if (mallid.indexOf('_') === -1) {
                    mallid = 'mall_' + mallid;
                }
                this.set('mallid', [mallid]);
            }
        }

        require('er/util').inherits(FormModel, BaseFormModel);
        return FormModel;
    }
);
